<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>

<div class="easyui-layout" fit="true" id="taskGroupForm">
 <t:formvalid formid="formobj" dialog="true"  layout="table" action="" beforeSubmit="" >
	<input name="id" type="hidden" value="${taskObj.id }">
    <div region="north"  style="height:35px;padding: 0px;border:0px;" >
	        <table style="width: 100%;" cellpadding="0" cellspacing="1" class="formtable" align="center">
		        <tr height="30">
					<td  width="10%" align="center"><label class="Validform_label">任务编号 </label></td>
					<td  class="value" width="15%">${taskObj.id }</td>
		            
		            <td width="10%" align="center"><label class="Validform_label">查询日期</label></td>
					<td class="value" width="15%">${taskObj.queryDate }</td>
					
					<td width="10%" align="center"><label class="Validform_label">集团用户数 </label></td>
					<td class="value" width="15%">${taskObj.groupNum }</td>
					
					<td width="10%" align="center"><label class="Validform_label" style="color:red;cursor:hand;" id="finish_task_lbl"><span onclick="finishTask();">点击完成</span> </label></td>
				</tr>						        
	        </table>
     </div>
  
    <div region="center" style="border:0px;padding: 0px;heigth:460px;" split="true">   
           
		<t:datagrid name="taskGroupList"  title="" actionUrl="groupPRController.do?taskGroupGrid&task_id=${taskObj.id }" idField="id" treegrid="false" pagination="true"  sortOrder="desc" sortName="id"  onLoadSuccess="">
            <t:dgCol title="" field="id" hidden="true"></t:dgCol> 
            <t:dgCol title="营业厅" field="groupInfo.createDepartmentname" width="40"></t:dgCol>
            <t:dgCol title="集团编号" field="groupInfo.id" width="60"></t:dgCol> 
            <t:dgCol title="集团名称" field="groupInfo.groupName" width="100" query="true"></t:dgCol>		
            <t:dgCol title="联系人" field="groupInfo.contactMan" width="60" ></t:dgCol>		
            <t:dgCol title="联系电话" field="groupInfo.contactPhone" width="60" ></t:dgCol>		
            <t:dgCol title="邮箱" field="groupInfo.contactEmail" width="80" ></t:dgCol>	
            <t:dgCol title="总户数" field="totalNum" width="40"  ></t:dgCol>	
            <t:dgCol title="电费总额(元)" field="totalAmount" width="60" ></t:dgCol>	
			<t:dgCol title="common.operation" field="opt" width="50"></t:dgCol>
            <t:dgFunOpt funname="showCustomerNoList(id)" title="集团户号"></t:dgFunOpt>	
            <t:dgDelOpt url="groupPRController.do?delTaskGroup&id={id}" title="删除"></t:dgDelOpt>				            
        </t:datagrid>
					
       
     </div>
  </t:formvalid>

</div>

<script type="text/javascript">
	
    function showCustomerNoList(id){
    	createdetailwindow("集团户号明细","groupPRController.do?goTaskCustomerNoList&id="+id,800,500) 
    
    }


    function finishTask(){
    	$.dialog.setting.zIndex = getzIndex(true);
    	$.dialog.confirm('是否确认邮件已发送、任务已完成？', function(){
    		
    		$('#formobj').form('submit', {  
    			url:'groupPRController.do?finishTask',
    		    onSubmit: function(){  
    		    	//进行表单验证  
    		        //如果返回false阻止提交  
    		    },  
    		    success:function(data){  
    		    	var d = $.parseJSON(data);
    		    	    $.messager.alert('信息提醒', d.msg, 'info',function(){
    		    		var win = frameElement.api.opener;
    			    	win.location.reload();
    		    	});    	
    		    	
    		    }  
    		}); 
    		
    	}, function(){
    	});
    	 
    	
    }
</script>

